package com.nbicc.dp.wsgateway.listener;

import com.nbicc.dp.wsgateway.common.WsPush;
import com.nbicc.dp.wsgateway.iservice.IWsPanelService;
import org.springframework.context.event.EventListener;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.io.IOException;

/**
 * @Author: lilingyan
 */
@Component
public class WidgetInstanceValueUpdateListener {

    @Resource(name = "WsPanelService")
    private IWsPanelService wsPanelService;

    @EventListener
    @Async
    public void listener(WsPush wsPush) throws IOException {
        wsPanelService.pushMsgToPanel(wsPush);
    }

}
